﻿using Little.Soldier;
using System;
using System.ComponentModel;

namespace Little.Soldier.SWIFT
{
  [ToolboxItem(false)]
  [TypeConverter(typeof(ISwiftBlock3))]
  [DesignTimeVisible(false)]
  [Serializable]
  public class SwiftBlock3 : SwiftTagListBlock
  {
    public override string BlockName
    {
      get
      {
        return "3";
      }
    }

    public override int BlockNumber
    {
      get
      {
        return 3;
      }
    }

    public virtual bool IsSTP
    {
      get
      {
        return this.ContainsTag("119") && this.GetTagValue("119").ToLower() == "stp";
      }
    }

    public SwiftBlock3(SwiftMessage swiftMessage)
      : base(swiftMessage)
    {
    }

    public SwiftBlock3(SwiftMessage swiftMessage, SwiftTag[] tags)
      : base(swiftMessage)
    {
      foreach (SwiftTag swiftTag in tags)
        this.Tags.Add(swiftTag);
    }

    public override void InitializeRules()
    {
    }
  }
}
